<template>
	<el-container>
		<el-main class='x-main-edit'>
			<el-form ref="form" :rules="form_rules" :model="form" size="mini" label-width="15%">
				<el-tabs type="border-card" v-model="page_tag">
					<!---->
					<!---->
					<el-tab-pane :label="page_info.title" name="1">
						<el-form-item label="选择车型" prop="ids">
							<div class="x_transfer">
								<el-transfer
									filterable
									filter-placeholder="请输入车型名称"
									v-model="form.ids"
									:titles="['未选择的车型', '已选择的车型']"
									:props="{
									  key: 'cspu_id',
									label: 'cspu_name'
									}"
									:data="page_info.list_spu">
								</el-transfer>
							</div>
						</el-form-item>
					</el-tab-pane>
					<!---->
					<!---->
					<el-tab-pane v-if="false" label="高级配置" name="2">
						<el-form-item label="用车限制" prop="cspu_only_plan">
							<el-radio-group v-model="form.cspu_only_plan">
								<el-radio :label="0">分时or套餐</el-radio>
								<el-radio :label="1">仅套餐</el-radio>
							</el-radio-group>
							<div class="x-alert">
								<span>仅套餐：只能购买套餐租车，不可使用分时租车</span><br/>
							</div>
						</el-form-item>
					</el-tab-pane>
					<!---->
					<!---->
				</el-tabs>
			</el-form>
			<!---->
			<!---->
			<!-- 按钮部分 -->
			<div class="save_wrap">
				<el-button @click="g_page.funcBack" size="mini">返回</el-button>
				<el-button type="success" @click="g_page.funcSave" size="mini">保存</el-button>
				<el-checkbox v-if="page_info.is_admin_edit" style="margin-left: 10px;" label="保存后停留" v-model="checked"/>
			</div>
			<!---->
			<!---->
			<!---->
		</el-main>
	</el-container>
</template>

<script>
	export default {
		data() {
			let page_data = {}
			//
			page_data = this.g_cc.funcGetInitData(page_data)
			//
			return page_data
		},
		mounted() {
			console.log('mounted')
			console.log(this.$route.query)

			this.g_page.funcSetVue(this)
			//
			this.g_page.funcSetApiUrlEdit('/xadmin/app_car/app_car__coupon_join__spu')
			this.g_page.funcSetApiUrlSave('/xadmin/app_car/app_car__coupon_join__spu/save')
			let page = this
			//验证
			this.form_rules = {
				__test: [{
					required: true,
					message: '请输入原密码',
					trigger: 'blur'
				}]
			}

			let data = this.$route.query
			this.g_page.funcEdit(data)
		},
		methods: {
			//
			funcShowDialogAfter() {
				console.log('funcShowDialogAfter')
			},
			//保存之前
			funcSaveBefore(data) {
				console.log('funcSaveBefore', data)

				// data.abc_str_00 = this.g_page.funcImgArrToStr(data.abc_str_00_imgs)

				return data
			}
		}
	}
</script>
